/** 
 * Project Name:jd-orm 
 * File Name:ConfigurationDatasourceBean.java 
 * Package Name:com.jd.orm.framework.configuration.bean 
 * Date:2014-5-12下午2:37:13 
 * Copyright (c) 2014, liubing1@jd.com All Rights Reserved. 
 * 
 */

package com.jd.orm.framework.configuration.bean;

/**
 * ClassName: ConfigurationDatasourceBean <br/>
 * Function: TODO Datasource property<br/>
 * Reason: TODO ADD REASON. <br/>
 * date: 2014-5-12 下午2:37:13 <br/>
 * 
 * @author liubing1@jd.com
 * @version
 * @since up JDK 1.5
 */

public class ConfigurationDatasourceBean {
	
	private String datasourceId;

	private String url;

	private String name;

	private String password;

	private String dataSourceClassName;

	private String driverClassName;

	private Integer initialSize = 10;// inital size

	private Integer minIdle = 10;

	private Integer maxActive = 50;

	private Integer maxWait = 60000;

	private Integer timeBetweenEvictionRunsMillis = 60000;

	private Long minEvictableIdleTimeMillis = 300000L;

	private String validationQuery = "SELECT 1";

	private Integer maxPoolPreparedStatementPerConnectionSize = 20;

	private Boolean testWhileIdle = true;

	private Boolean testOnBorrow = false;

	private Boolean testOnReturn = false;

	private Boolean poolPreparedStatements = true;

	public ConfigurationDatasourceBean(String datasourceId, String url,
			String name, String password, String dataSourceClassName,
			String driverClassName) {
		super();
		this.datasourceId = datasourceId;
		this.url = url;
		this.name = name;
		this.password = password;
		this.dataSourceClassName = dataSourceClassName;
		this.driverClassName = driverClassName;
	}

	public ConfigurationDatasourceBean(String datasourceId, String url,
			String name, String password, String dataSourceClassName,
			String driverClassName, Integer initialSize, Integer minIdle,
			Integer maxActive, Integer maxWait,
			Integer timeBetweenEvictionRunsMillis,
			Long minEvictableIdleTimeMillis, String validationQuery,
			Integer maxPoolPreparedStatementPerConnectionSize,
			Boolean testWhileIdle, Boolean testOnBorrow, Boolean testOnReturn,
			Boolean poolPreparedStatements) {
		super();
		this.datasourceId = datasourceId;
		this.url = url;
		this.name = name;
		this.password = password;
		this.dataSourceClassName = dataSourceClassName;
		this.driverClassName = driverClassName;
		this.initialSize = initialSize;
		this.minIdle = minIdle;
		this.maxActive = maxActive;
		this.maxWait = maxWait;
		this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
		this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
		this.validationQuery = validationQuery;
		this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
		this.testWhileIdle = testWhileIdle;
		this.testOnBorrow = testOnBorrow;
		this.testOnReturn = testOnReturn;
		this.poolPreparedStatements = poolPreparedStatements;
	}

	/**
	 * @return the datasourceId
	 */
	public String getDatasourceId() {
		return datasourceId;
	}

	/**
	 * @param datasourceId
	 *            the datasourceId to set
	 */
	public void setDatasourceId(String datasourceId) {
		this.datasourceId = datasourceId;
	}

	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @param url
	 *            the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the dataSourceClassName
	 */
	public String getDataSourceClassName() {
		return dataSourceClassName;
	}

	/**
	 * @param dataSourceClassName
	 *            the dataSourceClassName to set
	 */
	public void setDataSourceClassName(String dataSourceClassName) {
		this.dataSourceClassName = dataSourceClassName;
	}

	/**
	 * @return the driverClassName
	 */
	public String getDriverClassName() {
		return driverClassName;
	}

	/**
	 * @param driverClassName
	 *            the driverClassName to set
	 */
	public void setDriverClassName(String driverClassName) {
		this.driverClassName = driverClassName;
	}

	/**
	 * @return the initialSize
	 */
	public Integer getInitialSize() {
		return initialSize;
	}

	/**
	 * @param initialSize
	 *            the initialSize to set
	 */
	public void setInitialSize(Integer initialSize) {
		this.initialSize = initialSize;
	}

	/**
	 * @return the minIdle
	 */
	public Integer getMinIdle() {
		return minIdle;
	}

	/**
	 * @param minIdle
	 *            the minIdle to set
	 */
	public void setMinIdle(Integer minIdle) {
		this.minIdle = minIdle;
	}

	/**
	 * @return the maxActive
	 */
	public Integer getMaxActive() {
		return maxActive;
	}

	/**
	 * @param maxActive
	 *            the maxActive to set
	 */
	public void setMaxActive(Integer maxActive) {
		this.maxActive = maxActive;
	}

	/**
	 * @return the maxWait
	 */
	public Integer getMaxWait() {
		return maxWait;
	}

	/**
	 * @param maxWait
	 *            the maxWait to set
	 */
	public void setMaxWait(Integer maxWait) {
		this.maxWait = maxWait;
	}

	/**
	 * @return the timeBetweenEvictionRunsMillis
	 */
	public Integer getTimeBetweenEvictionRunsMillis() {
		return timeBetweenEvictionRunsMillis;
	}

	/**
	 * @param timeBetweenEvictionRunsMillis
	 *            the timeBetweenEvictionRunsMillis to set
	 */
	public void setTimeBetweenEvictionRunsMillis(
			Integer timeBetweenEvictionRunsMillis) {
		this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
	}

	/**
	 * @return the minEvictableIdleTimeMillis
	 */
	public Long getMinEvictableIdleTimeMillis() {
		return minEvictableIdleTimeMillis;
	}

	/**
	 * @param minEvictableIdleTimeMillis
	 *            the minEvictableIdleTimeMillis to set
	 */
	public void setMinEvictableIdleTimeMillis(Long minEvictableIdleTimeMillis) {
		this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
	}

	/**
	 * @return the validationQuery
	 */
	public String getValidationQuery() {
		return validationQuery;
	}

	/**
	 * @param validationQuery
	 *            the validationQuery to set
	 */
	public void setValidationQuery(String validationQuery) {
		this.validationQuery = validationQuery;
	}

	/**
	 * @return the maxPoolPreparedStatementPerConnectionSize
	 */
	public Integer getMaxPoolPreparedStatementPerConnectionSize() {
		return maxPoolPreparedStatementPerConnectionSize;
	}

	/**
	 * @param maxPoolPreparedStatementPerConnectionSize
	 *            the maxPoolPreparedStatementPerConnectionSize to set
	 */
	public void setMaxPoolPreparedStatementPerConnectionSize(
			Integer maxPoolPreparedStatementPerConnectionSize) {
		this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
	}

	/**
	 * @return the testWhileIdle
	 */
	public Boolean getTestWhileIdle() {
		return testWhileIdle;
	}

	/**
	 * @param testWhileIdle
	 *            the testWhileIdle to set
	 */
	public void setTestWhileIdle(Boolean testWhileIdle) {
		this.testWhileIdle = testWhileIdle;
	}

	/**
	 * @return the testOnBorrow
	 */
	public Boolean getTestOnBorrow() {
		return testOnBorrow;
	}

	/**
	 * @param testOnBorrow
	 *            the testOnBorrow to set
	 */
	public void setTestOnBorrow(Boolean testOnBorrow) {
		this.testOnBorrow = testOnBorrow;
	}

	/**
	 * @return the testOnReturn
	 */
	public Boolean getTestOnReturn() {
		return testOnReturn;
	}

	/**
	 * @param testOnReturn
	 *            the testOnReturn to set
	 */
	public void setTestOnReturn(Boolean testOnReturn) {
		this.testOnReturn = testOnReturn;
	}

	/**
	 * @return the poolPreparedStatements
	 */
	public Boolean getPoolPreparedStatements() {
		return poolPreparedStatements;
	}

	/**
	 * @param poolPreparedStatements
	 *            the poolPreparedStatements to set
	 */
	public void setPoolPreparedStatements(Boolean poolPreparedStatements) {
		this.poolPreparedStatements = poolPreparedStatements;
	}

}
